<%--
  Created by IntelliJ IDEA.
  User: 郝大哥
  Date: 2021/11/29
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 百度ECHarts</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="<%=request.getContextPath()%>/resource/favicon.ico"> <link href="<%=request.getContextPath()%>/resource/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/resource/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="<%=request.getContextPath()%>/resource/css/animate.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/resource/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>国内疫情较为严重5个省份</h5>
                </div>
                <div class="ibox-content">
                    <div style="height:600px" id="echarts-map-chart"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="<%=request.getContextPath()%>/resource/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=request.getContextPath()%>/resource/js/bootstrap.min.js?v=3.3.6"></script>



<!-- ECharts -->
<script src="<%=request.getContextPath()%>/resource/js/plugins/echarts/echarts-all.js"></script>

<!-- 自定义js -->
<script src="<%=request.getContextPath()%>/resource/js/content.js?v=1.0.0"></script>
<script>
    $(function(){//页面加载的时候进行调用
        $.ajax({
            url:"<%=request.getContextPath()%>/yq/getTop5Pro",
            type:"get",
            dataType:"json",
            success:function(res){
                var x=[];
                var y=[];
                for(var i=0;i<res.length;i++){
                   x.push(res[i].name);
                   y.push(res[i].econNum);
                }
                //1、绑定图表的div，初始化图表信息
                var myEcharts=echarts.init(document.getElementById("echarts-map-chart"));
                //2、设置图表的选项
                var option = {
                    title : {
                        text: '国内疫情最为严重的5个省份',
                        subtext: '数据来源于新浪'
                    },
                    tooltip : {
                        trigger: 'axis'
                    },
                    legend: {
                        data:['未治愈']
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : true,
                            dataView : {readOnly: false},
                            magicType:['line', 'bar'],
                            restore : true,
                            saveAsImage : true
                        }
                    },
                    calculable : true,
                    xAxis : [
                        {
                            type : 'category',
                            boundaryGap : false,
                            data : x
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            axisLabel : {
                                formatter: '{value} 例'
                            },
                            splitArea : {show : true}
                        }
                    ],
                    series : [
                        {
                            name:'未治愈',
                            type:'line',
                            itemStyle: {
                                normal: {
                                    lineStyle: {
                                        shadowColor : 'rgba(0,0,0,0.4)'
                                    }
                                }
                            },
                            data:y
                        }
                    ]
                };

                //3、加载图片选项
                myEcharts.setOption(option);
            }
        });
    })
</script>



</body>

</html>

